package sequencer;

import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

import common.Sequencer;

public class SequencerMain {

	public static void main(String[] args) {


		try {

			LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
			String name = "sequencer";
			Sequencer sequencer = new SequencerImpl();
			Sequencer stub =
					(Sequencer) UnicastRemoteObject.exportObject(sequencer, 0);
			Registry registry = LocateRegistry.getRegistry();
			registry.rebind(name, stub);
			System.out.println("Sequencer bound");

		} catch (RemoteException e) {
			System.err.println("Sequencer exception:");
			e.printStackTrace();
		}

	}

}
